package com.developmentReformProject.service.impl;


import com.developmentReformProject.dao.ApplyDao;
import com.developmentReformProject.dto.ApplyDto;
import com.developmentReformProject.dto.ApplyQueryDto;
import com.developmentReformProject.entity.Admin;
import com.developmentReformProject.entity.Apply;
import com.developmentReformProject.entity.Enterprise;
import com.developmentReformProject.service.AuditProjectLibraryService;
import com.developmentReformProject.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service

public class AuditProjectLibraryServiceImpl implements AuditProjectLibraryService {
    @Autowired
    private ApplyDao applyDao;
    @Override
    public String addProject(Apply apply) {
        return null;
    }

    @Override
    public String updateProject(Apply apply) {
        return null;
    }

    @Override
    public String deleteProject(Integer projectNo) {
        return null;
    }

    @Override
    public String deleteProject(int[] projectNos) {
        return null;
    }

    @Override
    public ApplyDto queryProjectById(Integer projectNo) {
        return null;
    }

    @Override
    public List<ApplyDto> queryProjectList(List[] projectNo) {
        return null;
    }

    @Override
    public List<ApplyDto> queryProjectByConstructionStatus(String constructionStatus) {
        return null;
    }

    @Override
    public List<ApplyDto> queryProjectByentEnterpriseNumber(Enterprise enterprise) {
        return null;
    }

    @Override
    public List<ApplyDto> queryProjectByRevenue(Double revenue) {
        return null;
    }

    @Override
    public List<ApplyDto> queryProjectBySpecificType(String specificType) {
        return null;
    }

    @Override
    public String reportExport(Integer projectNo) {
        return null;
    }

    @Override
    public String auditAnalysis(Integer projectNo) {
        return null;
    }

    @Override
    public PageUtil<Apply> pageList(ApplyQueryDto applyQueryDto) throws Exception {
        PageUtil<Apply> pageUtil=null;
        //统计满足条件记录总数
        int total=applyDao.countSelective(applyQueryDto);
        /*
         * 如果total>0,查询数据
         * 封装到pageUtil
         */
        if(total>0){
            List<Apply> data=applyDao.selectSelective(applyQueryDto);
            pageUtil=new PageUtil<>(total, data, applyQueryDto.getCurrentPage(), applyQueryDto.getPageSize());
        }
        return pageUtil;
    }

    @Override
    public PageUtil<Apply> cleanAdmin(ApplyQueryDto applyQueryDto) throws Exception {
        PageUtil<Apply> pageUtil=null;
        //统计满足条件记录总数
        int total=applyDao.countClean(applyQueryDto);
        /*
         * 如果total>0,查询数据
         * 封装到pageUtil
         */
        if(total>0){
            List<Apply> data=applyDao.listDelete(applyQueryDto);
            pageUtil=new PageUtil<>(total, data, applyQueryDto.getCurrentPage(), applyQueryDto.getPageSize());
        }
        return pageUtil;
    }
}
